import createPersistedState from "vuex-persistedstate"
import {userApi} from "@/api/user/user";

export default {
    namespaced: true,
    state: {
        user: {}
    },

    actions: {
        getUserInfo(ctx, args) {
            userApi.getUserInfo().then(resp => {
                if (resp.code === 200) {
                    ctx.state.user = resp.data
                }
            })
        }
    },
    mutations: {
        setUser(state, user) {
            state.user = user
        }
    },
    getters: {},

}